﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SkyFab.Master" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="Web.ProductList" %>
<%@ Import Namespace="Web" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:Label ID="FlashMessageLabel" runat="server"></asp:Label>
    <h1>Product List</h1>

    <div class="span-18">
    <fieldset>
    <legend>Search Product</legend>
     <label>Select Category:</label>
                <asp:DropDownList ID="CategoryDropDownList" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="CategoryDropDownList_SelectedIndexChanged" Width="150">
                </asp:DropDownList>

    <label>Or Input To Search:</label>
        <asp:TextBox ID="ProductNoTextBox" runat="server" CssClass="text" Width="180"></asp:TextBox>
                
                    <br />
    <label>Only Show Products In Hand, Please Check: </label>
    <asp:CheckBox ID="ShowProductInHandCheckBox" runat="server" />
    <asp:Button ID="SearchButton" runat="server" onclick="SearchButton_Click" CssClass="submitButton"
                    Text="Search" />
    </fieldset>
    </div>

    <div class="span-18">
    <asp:GridView ID="ProductListGridView" runat="server" 
                    AutoGenerateColumns="False" CellPadding="4" 
                    GridLines="None" AllowPaging="True" 
                    onpageindexchanging="ProductListGridView_PageIndexChanging" 
                       CssClass="gridview" Width="100%">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:TemplateField HeaderText="Product No">
                            <ItemTemplate>
                                <asp:HyperLink ID="ProductNoHyperLink" runat="server" 
                                    NavigateUrl='<%# "ProductDetail.aspx?id="+Eval("Id") %>'><%# Eval("No") %></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Name" HeaderText="Name" />
                        <asp:BoundField DataField="Description" HeaderText="Description" />
                        <asp:BoundField DataField="Revision" HeaderText="Rev." />
                        <asp:BoundField DataField="Stock" HeaderText="Stock" />
                    </Columns>
                    
                    <AlternatingRowStyle BackColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle HorizontalAlign="Center" CssClass="pagerTable" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                </asp:GridView>
                <br />
                <asp:Label ID="NofoundLabel" runat="server" ForeColor="Red"></asp:Label>
    </div>
</asp:Content>
